﻿using DAL;
using Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class B_Admin
    {
        DAL.D_Admin d_admin = new DAL.D_Admin();

        public int Login(Models.Admin m_admin)
        {
            //var res = d_admin.Login(m_admin);

            int i = 0;
            bool res = false;
            while (!(res = d_admin.Login(m_admin)))
            {
                i++;
                if (i == 3)
                    break;
            }

            return res ? 0 : 1;
        }

        public bool save_List(List<Admin> m_admin)
        {

            return d_admin.save_List(m_admin);
        }

        public List<Admin> GetList()
        {
            return d_admin.GetList();
        }

        public bool Add(List<Admin> admins)
        {
            return d_admin.save_List(admins);
        }

        public bool Del(List<Admin> list)
        {
            return d_admin.Del(list);
        }
    }
}
